#ifndef __CARDS_H__
#define __CARDS_H__

enum CARD_TYPE {
    SPADE = 0,
    HEART = 1,
    CLUB  = 2,
    DIAMAND = 3
};

// Class for one card
class Card {
public:
    Card();
    ~Card();

    // Set the card value
    void set(int val, CARD_TYPE type);

    // Get the card value
    void get(int &val, CARD_TYPE &type);

private:
    CARD_TYPE type_;
    int val_;
};

// Class for a deck of cards
class Decks {
public:
    Decks(int card_num);
    ~Decks();

    // Get the card according to the index
    Card *getCard(int index);

    // Set num of cards used in a game
    bool setCardNum(int card_num);

    // Shuffle the cards in the deck
    // Different algorithms can be used
    bool shuffle();

private:
    // Each deck has 54 cards
    Card *cards_ptr_;
};

class Player {
public:
    Player();
    ~Player();

    // Retrieve cards
    bool retrieveCards();

    // Set card num used in a game
    void setCardNum(int num);

    // The card the player uses in a round
    Card *playCard();

private:

    char name_[256];
    unsigned int credits_;

    Card *cards_;

    // Statistics information
    unsigned int num_of_games_
    unsigned int num_win_;
    unsigned int num_lose_;
};

class Game {
public:
    Game();
    ~Game();

    void play();
    unsigned int *getWinners();

private:
    Player *players_;
    unsigned int num_players_;
    Decks *decks_;

    unsigned int *winnners_;

    char name_[256];
    int total_card_num;
};
    
#endif

